﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DiPlaner.Profile
{
    public partial class WinMarker : Form
    {
        public Size size;
        public Point pos;
        public Point sys;

        public WinMarker()
        {
            InitializeComponent();
        }

        private void WinMarker_ResizeEnd(object sender, EventArgs e)
        {
            size = new Size((Size.Width) / 5 * 5, (Size.Height) / 5 * 5);
            Size = size;
            lb_size.Text = string.Format("Size: {0:0000} x {1:0000}", Size.Width, Size.Height);
        }

        private void WinMarker_LocationChanged(object sender, EventArgs e)
        {
            if (Location.X <= 0) Location = new Point(0, Location.Y);
            if (Location.Y <= 0) Location = new Point(Location.X, 0); 
            pos = new Point(Location.X / 5 * 5, Location.Y / 5 * 5);
            Location = pos;
            lb_pos.Text = string.Format("Pos: {0:0000} x {1:0000}", Location.X, Location.Y);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void WinMarker_Load(object sender, EventArgs e)
        {
            lb_pos.Text = string.Format("Pos: {0:0000} x {1:0000}", Location.X, Location.Y);
            lb_size.Text = string.Format("Size: {0:0000} x {1:0000}", Size.Width, Size.Height);
        }

    }
}
